package org.example.springkafka.Consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.example.springkafka.POJO.User;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumer1 {
    @KafkaListener(topics = {"user"},topicPartitions = {})
    public void OnMessage(ConsumerRecord<String, User> record) {
        System.out.println("消费对象:"+"topic:"+record.topic()+"offset:"+record.offset()+"key:"+record.key()+"value:"+record.value());
    }

}
